package cn.zhl.linkedlist;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @program: demos
 * @description:
 * @author: 刘振华
 * @create: 2020-04-02 14:16
 **/
@Data
public class LinkedList<E> {

	private Integer size;

	private Node<E> first;

	public LinkedList() {
		size = 0;
		first = null;
	}

	public Integer size() {
		return size;
	}

	public Boolean isEmpty() {
		return size == 0;
	}

	@NoArgsConstructor
	//静态内部类，一般都要静态的
	private static class Node<E> {
		E element;
		Node<E> next;

		public Node(E element, Node<E> next) {
			this.element = element;
			this.next = next;
		}
	}
}
